﻿@{;
  ViewBag.Title = "明细页面";
  Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = request('keyValue');
    $(function () {
        initControl();
    });
    //初始化控件
    function initControl() {
        //客户级别
        $("#F_CustLevelId").ComboBox({
            url: "../../SystemManage/DataItemDetail/GetDataItemListJson",
            param: { EnCode: "Client_Level" },
            id: "F_ItemValue",
            text: "F_ItemName",
            description: "==请选择==",
            height: "200px"
        });
        //客户类别
        $("#F_CustTypeId").ComboBox({
            url: "../../SystemManage/DataItemDetail/GetDataItemListJson",
            param: { EnCode: "Client_Sort" },
            id: "F_ItemValue",
            text: "F_ItemName",
            description: "==请选择==",
            height: "200px"
        });
        //客户程度
        $("#F_CustDegreeId").ComboBox({
            url: "../../SystemManage/DataItemDetail/GetDataItemListJson",
            param: { EnCode: "Client_Degree" },
            id: "F_ItemValue",
            text: "F_ItemName",
            description: "==请选择==",
            height: "200px"
        });
        //跟进人员
        $("#F_TraceUserId").ComboBoxTree({
            url: "../../BaseManage/User/GetTreeJson",
            description: "==请选择==",
            height: "320px",
            allowSearch: true
        });
        //公司行业
        $("#F_CustIndustryId").ComboBox({
            url: "../../SystemManage/DataItemDetail/GetDataItemListJson",
            param: { EnCode: "Client_Trade" },
            id: "F_ItemValue",
            text: "F_ItemName",
            description: "==请选择==",
            height: "200px"
        });
        //所在省份
        $("#F_Province").ComboBox({
            url: "../../SystemManage/Area/GetAreaListJson",
            param: { parentId: "0" },
            id: "F_AreaCode",
            text: "F_AreaName",
            description: "==选择省==",
            height: "200px"
        }).bind("change", function () {
            var value = $(this).attr('data-value');
            $("#F_City").ComboBox({
                url: "../../SystemManage/Area/GetAreaListJson",
                param: { parentId: value },
                id: "F_AreaCode",
                text: "F_AreaName",
                description: "==选择市==",
                height: "200px"
            });
        });
        //所在城市
        $("#F_City").ComboBox({
            description: "==选择市==",
            height: "200px"
        });

        //获取表单
        if (!!keyValue) {
            $.SetForm({
                url: "../../CustomerManage/Customer/GetFormJson",
                param: { keyValue: keyValue },
                success: function (data) {
                    $("#form1").SetWebControls(data);
                    $("#F_Province").trigger("change"); $("#F_City").ComboBoxSetValue(data.F_City)
                }
            })
        }
    }
</script>
<div style="margin-top: 20px; margin-bottom: 20px; margin-right: 20px;">
    <table class="form">
        <tr>
            <td class="formTitle">客户名称</td>
            <td class="formValue">
                <input id="F_FullName" type="text" class="form-control" />
            </td>
            <td class="formTitle">客户简称</td>
            <td class="formValue">
                <input id="F_ShortName" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">客户级别</td>
            <td class="formValue">
                <div id="F_CustLevelId" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull"></div>
            </td>
            <td class="formTitle">客户类别</td>
            <td class="formValue">
                <div id="F_CustTypeId" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull"></div>
            </td>
        </tr>
        <tr>
            <td class="formTitle">客户程度</td>
            <td class="formValue">
                <div id="F_CustDegreeId" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull"></div>
            </td>
            <td class="formTitle">跟进人员</td>
            <td class="formValue">
                <div id="F_TraceUserId" type="selectTree" class="ui-select" isvalid="yes" checkexpession="NotNull"></div>
            </td>
        </tr>
        <tr>
            <td class="formTitle">公司行业</td>
            <td class="formValue">
                <div id="F_CustIndustryId" type="select" class="ui-select"></div>
            </td>
            <td class="formTitle">公司网站</td>
            <td class="formValue">
                <input id="F_CompanySite" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">公司情况</td>
            <td class="formValue" colspan='3'>
                <input id="F_CompanyDesc" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">公司地址</td>
            <td class="formValue" colspan='3'>
                <input id="F_CompanyAddress" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">所在省份</td>
            <td class="formValue">
                <div id="F_Province" type="select" class="ui-select"></div>
            </td>
            <td class="formTitle">所在城市</td>
            <td class="formValue">
                <div id="F_City" type="select" class="ui-select"></div>
            </td>
        </tr>

        <tr>
            <td class="formTitle">联系人</td>
            <td class="formValue">
                <input id="F_Contact" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
            </td>
            <td class="formTitle">手机</td>
            <td class="formValue">
                <input id="F_Mobile" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">电话</td>
            <td class="formValue">
                <input id="F_Tel" type="text" class="form-control" />
            </td>
            <td class="formTitle">传真</td>
            <td class="formValue">
                <input id="F_Fax" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">QQ</td>
            <td class="formValue">
                <input id="F_QQ" type="text" class="form-control" />
            </td>
            <td class="formTitle">Email</td>
            <td class="formValue">
                <input id="F_Email" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">微信</td>
            <td class="formValue">
                <input id="F_Wechat" type="text" class="form-control" />
            </td>
            <td class="formTitle">爱好</td>
            <td class="formValue">
                <input id="F_Hobby" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">备注</td>
            <td class="formValue" colspan='3'>
                <textarea id="F_Description" class="form-control" style="height: 50px;"></textarea>
            </td>
        </tr>
        <tr>
            <td class="formTitle">创建用户</td>
            <td class="formValue">
                <input id="F_CreateUserName" type="text" class="form-control" />
            </td>
            <td class="formTitle">创建时间</td>
            <td class="formValue">
                <input id="F_CreateDate" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">修改用户</td>
            <td class="formValue">
                <input id="F_ModifyUserName" type="text" class="form-control" />
            </td>
            <td class="formTitle">修改时间</td>
            <td class="formValue">
                <input id="F_ModifyDate" type="text" class="form-control" />
            </td>
        </tr>
    </table>
</div>
